class ParamsPool {
    static USER_PHOTH = null
    static USER_SEX = Math.floor(Math.random() * 2 + 1)
    static RES_PHOTO = null
    static CUT_PHONT = null
    static OSS_URL = 'https://miva-unmcc.oss-cn-beijing.aliyuncs.com/cl/photo/'
    static CheckMdel() {
        const num = Math.floor(Math.random() * 7 + 1)
        const str = `${ParamsPool.OSS_URL}${ParamsPool.USER_SEX}_${num}.png`
        return str
    }
    static MergeFace(template_url?: string) {
        const merge_base64 = ParamsPool.USER_PHOTH
        return new Promise((resolve, reject) => {
            $.post('https://api-cn.faceplusplus.com/imagepp/v1/mergeface', {
                api_key: 't2ACALhMviNagZtF6QqPAuDQtv8Nb5XU',
                api_secret: 'zzQSCGtK-2zHTg58DB4QcWwFBKMNn9sw',
                template_url: ParamsPool.CheckMdel(),
                merge_base64,
                merge_rate: 90
            }).then(res => {
                console.log('合成成功', res)
                ParamsPool.RES_PHOTO = res.result
                resolve(true)
            })
        })
    }
}